import torch
import torch.nn as nn
from math import exp


torch.manual_seed(7)

class NerualNet_yieldRate(nn.Module):
    def __init__(self):
        super(NerualNet_yieldRate, self).__init__()

        # self.layer1=nn.Linear(14, 8)
        # self.layer2=nn.Linear(8, 4)
        # self.dropout = nn.Dropout(p=0.5)
        # self.activation=nn.Tanh()
        # self.layer3=nn.Linear(4, 1)

        self.layers = nn.Sequential(
            # nn.Linear(14, 6),
            # nn.Sigmoid(),
            # nn.Linear(6, 1),

            # nn.Linear(14, 8),
            # nn.Linear(8, 4),
            # nn.Tanh(),
            # nn.Linear(4, 1),


            # nn.Linear(64, 32),
            nn.Linear(14, 8),
            nn.Linear(8, 4),
            nn.Tanh(),
            nn.Linear(4, 1),


            # nn.Linear(14, 8),
            # nn.ReLU(),
            # nn.Linear(8, 3),
        )



        # self.layer1_content = nn.Sequential(
        #     nn.Linear(3, 1),
        #     nn.Tanh(),
        # )
        # self.layer1_surface = nn.Sequential(
        #     nn.Linear(4, 1),
        #     nn.Tanh(),
        # )
        # self.layer1_element = nn.Sequential(
        #     nn.Linear(6, 1),
        #     nn.Tanh(),
        # )
        # self.layer2 = nn.Sequential(
        #     nn.Linear(4, 1),
        # )

    def forward(self, x):
        # print('x.shape: ',x.shape)

        # x_weight=x[:,0:1]
        # x_content=self.layer1_content(x[:,1:4])
        # x_surface=self.layer1_surface(x[:,4:8])
        # x_element=self.layer1_element(x[:,8:14])
        # x=torch.cat([x_weight,x_content,x_surface,x_element],1)
        # x=self.layer2(x)



        # x=self.layer1(x)
        # x=self.layer2(x)
        # x=self.activation(x)
        # x=self.layer3(x)

        x = self.layers(x)
        x = x.squeeze(-1)

        return x
